package com.gragra.structures.generators;
import com.gragra.structures.generators.SplitOnWhiteSpaceCodeToIntegerGenerator;
import com.gragra.util.ReplaceWithSelf;
import com.gragra.util.ReplaceWithSelfAndDownCase;
/**
 * a simple SentenceStructure generator that splits on whitespace, places all
 * punctuation between whitespace and converts to downcase according to the default
 * local.
 * @author Christoph Teichmann
 * created Nov 3, 2012 6:04:25 PM
 * @version 0.1
 */
public class SplitDownAndTokenPunctuation extends
		SplitOnWhiteSpaceCodeToIntegerGenerator
{
	/**
	 * implements the splitting of of punctuation.
	 */
	private ReplaceWithSelf rws = new ReplaceWithSelfAndDownCase(".:,;\"\'`'?!()");
	/**
	 * overwrites the process method to add conversion to lowercase
	 * @param input
	 * @return
	 */
	protected String process(String input)
	{
		String ret = rws.apply(input.toLowerCase());
		return ret;
	}	
}